package a.f.e;

import a.c.e;
import a.c.y;
import a.c.z;
import a.d.t;
import a.d.w;
import a.f.*;

class j
{
  private static final zc a = new sb(0.0D, 0.0D, 30.0D, 30.0D);
  private static final a.d.o[] b = { new a.d.o(15.0D, 5.0D, 30.0D, 10.0D, 1.0D, 0.0D), new a.d.o(-15.0D, -15.0D, 100.0D, 30.0D, 0.5D, 0.5D), new a.d.o(50.0D, 90.0D, 40.0D, 15.0D, 0.0D, -1.0D) };
  
  static z a(a.f.o paramo, e parame, xc paramxc, yc paramyc, boolean paramBoolean)
  {
    int j = a.B;
    int i = a.A;
    z localz1 = new z();
    zc localzc = paramo.d(parame);
    yc localyc = paramxc.a();
    if (j == 0) {}
    Object localObject1 = paramxc.e() == null ? localyc.a() : paramxc.e();
    if (j == 0) {}
    a.d.o localo = localyc == null ? paramxc.d() : localyc.a(paramxc.d().f(), localzc, localObject1);
    if (j == 0)
    {
      if (paramBoolean) {
        localz1.add(new hc(localo, localObject1, paramxc, false));
      }
    }
    else {
      if (i == 0) {
        break label283;
      }
    }
    y localy;
    if (((j != 0) || (paramyc != null)) && ((j != 0) || (paramyc != localyc)))
    {
      Object localObject2 = paramyc.a(localo, localzc);
      xc localxc = a(paramxc.d(), paramyc, localObject2);
      z localz2 = a(paramo, parame, localxc, paramyc);
      localy = localz2.h();
    }
    while (localy.e())
    {
      hc localhc = (hc)localy.j();
      if (j == 0)
      {
        if (i != 0) {
          break label285;
        }
        localz1.add(a(localhc, paramxc, localyc, localzc));
        localy.f();
      }
      if (i != 0)
      {
        if (j != 0) {
          break label285;
        }
        localz1.addAll(a(paramo, parame, paramxc, localyc));
      }
    }
    label283:
    label285:
    return localz1;
  }
  
  private static z a(a.f.o paramo, e parame, xc paramxc)
  {
    return a(paramo, parame, paramxc, 4.0D);
  }
  
  private static z a(a.f.o paramo, e parame, xc paramxc, yc paramyc)
  {
    int i = a.B;
    zc localzc = paramo.d(parame);
    if ((i != 0) || (paramyc != null))
    {
      if (i != 0) {
        break label41;
      }
      if (!a(paramyc)) {}
    }
    else
    {
      return a(paramo, parame, paramxc);
    }
    label41:
    return paramyc.a(paramxc, localzc);
  }
  
  private static z a(a.f.o paramo, e parame, xc paramxc, double paramDouble)
  {
    int i1 = a.B;
    int n = a.A;
    z localz = new z();
    a.d.o localo1 = paramxc.d();
    t localt1 = paramxc.c();
    yc localyc = paramxc.a();
    zc localzc = paramo.d(parame);
    t localt2 = paramo.v(parame);
    int i = a(paramo);
    int j = (int)Math.max(3.0D, localt2.b / localt1.b);
    j = Math.min(j, i);
    double d1 = (localt2.b - localt1.b) / (j - 1);
    double d2 = localt2.d() - paramDouble - localt1.a;
    double d3 = localt2.d() + localt2.a + paramDouble;
    double d4 = localt2.e();
    int k = 0;
    do
    {
      if (k >= j) {
        break;
      }
      w localw1 = new w(d2, d4);
      a.d.o localo2 = new a.d.o(localo1);
      localo2.g(localw1.a() + localt1.b() * 0.5D, localw1.b() + localt1.c() * 0.5D);
      Object localObject1 = localyc.a(localo2, localzc);
      hc localhc1 = new hc(localo2, localObject1, paramxc, false);
      localz.add(localhc1);
      w localw2 = new w(d3, d4);
      a.d.o localo3 = new a.d.o(localo1);
      localo3.g(localw2.a() + localt1.b() * 0.5D, localw2.b() + localt1.c() * 0.5D);
      localObject1 = localyc.a(localo3, localzc);
      localhc1 = new hc(localo3, localObject1, paramxc, false);
      localz.add(localhc1);
      if (i1 != 0) {
        break label443;
      }
      d4 += d1;
      k++;
      if (n != 0) {
        break label430;
      }
    } while (n == 0);
    j = (int)Math.max(3.0D, localt2.a / localt1.a + 2.0D);
    j = Math.min(j, 15);
    if (i1 == 0) {
      d1 = (localt2.a + localt1.a) / (j - 1);
    }
    label430:
    label443:
    double d5 = localt2.e() - paramDouble - localt1.b;
    double d6 = localt2.e() + localt2.b + paramDouble;
    double d7 = localt2.d() - localt1.a;
    int m = 0;
    do
    {
      if (m >= j) {
        break;
      }
      w localw3 = new w(d7, d5);
      a.d.o localo4 = new a.d.o(localo1);
      localo4.g(localw3.a() + localt1.b() * 0.5D, localw3.b() + localt1.c() * 0.5D);
      Object localObject2 = localyc.a(localo4, localzc);
      hc localhc2 = new hc(localo4, localObject2, paramxc, false);
      localz.add(localhc2);
      w localw4 = new w(d7, d6);
      a.d.o localo5 = new a.d.o(localo1);
      localo5.g(localw4.a() + localt1.b() * 0.5D, localw4.b() + localt1.c() * 0.5D);
      localObject2 = localyc.a(localo5, localzc);
      localhc2 = new hc(localo5, localObject2, paramxc, false);
      if (i1 == 0)
      {
        if (n != 0) {
          break label700;
        }
        localz.add(localhc2);
        d7 += d1;
        m++;
      }
    } while (n == 0);
    label700:
    return localz;
  }
  
  private static hc a(hc paramhc, xc paramxc, yc paramyc, zc paramzc)
  {
    Object localObject = paramyc.a(paramhc.j(), paramzc);
    a.d.o localo = paramyc.a(paramhc.j().f(), paramzc, localObject);
    return new hc(localo, localObject, paramxc, false);
  }
  
  private static xc a(a.d.o paramo, yc paramyc, Object paramObject)
  {
    nc localnc = new nc();
    localnc.a(paramyc);
    localnc.a(paramObject);
    localnc.a(paramo);
    return localnc;
  }
  
  private static boolean a(yc paramyc)
  {
    int k = a.B;
    int j = a.A;
    if (k == 0) {
      if ((paramyc instanceof cc)) {
        return true;
      }
    }
    int i = 0;
    do
    {
      if (i >= b.length) {
        break;
      }
      Object localObject = paramyc.a(b[i], a);
      a.d.o localo = paramyc.a(b[i].f(), a, localObject);
      if (j != 0) {
        break label97;
      }
      if (!a.d.o.a(b[i], localo, 1.0D)) {
        return false;
      }
      i++;
    } while (j == 0);
    label97:
    return true;
  }
  
  private static int a(a.f.o paramo)
  {
    int j = a.B;
    int i = 15;
    if (j == 0)
    {
      if (paramo.k() > 100)
      {
        i = 10;
        if (j != 0) {
          break label50;
        }
        if (a.A == 0) {}
      }
      else
      {
        if (j != 0) {
          break label50;
        }
      }
    }
    else if (paramo.k() > 500) {
      i = 5;
    }
    label50:
    return i;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.e.j

 * JD-Core Version:    0.7.0.1

 */